// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   DefaultDBConnImpl.java

package com.vandagroup.common.treedic;

import java.sql.*;

// Referenced classes of package com.vandagroup.common.treedic:
//            DBConnection, ParaManage

public class DefaultDBConnImpl
    implements DBConnection
{

    public DefaultDBConnImpl()
    {
    }

    public Connection getConnection()
        throws ClassNotFoundException, SQLException
    {
        String driver = ParaManage.getParaXML("DBCONF_PARAMETERS", "DBCONF_PARAMETER", "DRIVER", "");
        String url = ParaManage.getParaXML("DBCONF_PARAMETERS", "DBCONF_PARAMETER", "URL", "");
        String userName = ParaManage.getParaXML("DBCONF_PARAMETERS", "DBCONF_PARAMETER", "USERNAME", "");
        String password = ParaManage.getParaXML("DBCONF_PARAMETERS", "DBCONF_PARAMETER", "PASSWORD", "");
        Class.forName(driver);
        Connection conn = DriverManager.getConnection(url, userName, password);
        return conn;
    }

    public void freeConnection(Connection conn)
    {
        try
        {
            conn.close();
        }
        catch(Exception exception) { }
    }
}
